<template>
	<div>
    <title1 ref="title1" @getFatherData="setData" :value="titleValue"></title1>
    <body1 ref="body1" :urlArray="urlArray"></body1>
    <footer1 ref="footer1" @getcont="getc" :count="count":list="list"></footer1>
    <button @click="getsunData">点击我看到子属性的属性</button>
    <button @click="getsunChangeData">看到子变化的属性</button>
    <button @click="setNum">增加1</button>

  </div>
</template>

<script>
  import title1 from '@/components/title'
  import body1 from '@/components/body'
  import footer1 from '@/components/footer'
	export default{
    name:"index",
		data(){
			return{
        titleValue:"我是传递给头部组件的内容",
        urlArray:[require("../assets/01.jpg"),require("../assets/logo.png")],
        count:300,
        list:[123,123,123412,12],

			}
		},
		components:{
      title1
      ,body1
      ,footer1
		},
		methods:{
      getsunData(){
        console.log(body1)
        let sunData=this.$refs.body1.getsunData();
        console.log(sunData)
      },
      getsunChangeData(){
let sunname=this.$refs.title1.getName();
        console.log(sunname)
      },
      setData(){
        console.log("我在子组件中被调用了！")
      },
      setNum(){
        this.$refs.footer1.adds();

      },
      getc(){
        this.count++
      }
		},
    mounted(){
      this.count=400;
    }
	}
</script>

<style>
</style>
